<?php
class BaseAction extends Action
{
    public function _initialize()
	{
	    if (!$this->curr_nav) {
	        $this->curr_nav = 'index';
	    }
		$this->assign('curr_nav', $this->curr_nav);
	}
	
	public function check_login()
	{
	    if (isset($_SESSION['user_info']) && $_SESSION['user_info']) {
	        $user_info = unserialize($_SESSION['user_info']);
	        return $user_info;
	    } else {
	        $_SESSION['last_page'] = $_SERVER['HTTP_REFERER'];
	        redirect(u('member/loginup'));
	    }
	}
	
	protected function error($message, $url_forward='',$ms = 3, $ajax=false)
	{
	    $this->jumpUrl = $url_forward;
	    $this->waitSecond = $ms;
	    parent::error($message, $ajax);
	}
	
	protected function success($message, $url_forward='',$ms = 3, $ajax=false)
	{
	    $this->jumpUrl = $url_forward;
	    $this->waitSecond = $ms;
	    parent::success($message, $ajax);
	}
}
?>